package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.WarehousingMapper;
import com.youlai.boot.system.mapper.WinteringMapper;
import com.youlai.boot.system.model.QB.Warehousing;
import com.youlai.boot.system.service.WarehousingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class WarehousingServiceImpl extends ServiceImpl<WarehousingMapper, Warehousing> implements WarehousingService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private WarehousingMapper warehousingMapper;
    @Override
    public boolean saveWarehousing(Warehousing wintering) {

        wintering.setAddtime(LocalDateTime.now());
        return save(wintering);
    }

    @Override
    public List<Warehousing> getAllWintering() {
        return warehousingMapper.selectList(null);
    }

    @Override
    public boolean deleteWarehousingById(Integer id) {
        return warehousingMapper.deleteById(id) > 0;
    }
}
